package com.qffx.moviebase.presenter;

import android.content.Context;

import com.qffx.moviebase.bean.ADEntity;
import com.qffx.moviebase.model.ADModel;
import com.qffx.moviebase.model.impl.IADM;
import com.qffx.moviebase.view.impl.IADview;

import java.util.ArrayList;
import java.util.List;


public class ADPresenter implements IADM {
    private Context context;
    private IADview iADview;
    private List<ADEntity.SplashBean> data;

    private ADModel model;

    public ADPresenter(Context context, IADview iADview) {
        this.context = context;
        this.iADview = iADview;
        data = new ArrayList<>();
        model = new ADModel(context, this);
    }

    public void initData() {
        model.loadData();
    }

    @Override
    public void sendData(List<ADEntity.SplashBean> list) {
        data.addAll(list);
        iADview.sendImageUrl(list.get(0).getImgurl());

    }
}
